<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>05-Css3盒子模型</title>
  <style>
    div:nth-child(1) {
      width: 200px;
      height: 200px;

      /* 传统盒子模型：从内容区域开始计算 */
      box-sizing: content-box;

      border: 10px solid red;
      background: pink;
    }

    div:nth-child(2) {
      width: 200px;
      height: 200px;
      padding: 10px;

      /* css3盒子模型: 加上这句话就让盒子变成了Css3盒子, 从边框开始计算 */
      /* padding与border不会再撑大盒子了 */
      box-sizing: border-box;
      background: purple;
    }
  </style>
</head>

<body>

  <div></div>
  <div></div>

</body>

</html>